#include"process.h"
#include<unistd.h>

//场景
double target_file_size=1024.0;//M,目标文件大小
double speed=1.0;//M

void DownLoad(double size,double split)
{
	double current_total=0.0;
	while(current_total<=size)
	{
		//下载我们用sleep来模拟
	    FlushProcess(size,0.0);//进度条不能一次性刷新完，根据具体进度进行刷新
		if(current_total>=size)break;
		usleep(10000);//代表一次下载
		current_total+=split;
	}
}

int main()
{
	printf("下载中\n");
	DownLoad(target_file_size,speed);
	return 0;
}


